package com.zsy.text.to.phone.service.impl;

import com.zsy.text.to.phone.domain.TextBO;
import com.zsy.text.to.phone.repository.TextRepository;
import com.zsy.text.to.phone.service.TextService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TextServiceImpl implements TextService {

    @Autowired
    private TextRepository textRepository;

    @Override
    public String getCurText() {
        return textRepository.selectCurText().getText();
    }

    @Override
    public void insertText(String s) {
        TextBO text = new TextBO();
        text.setText(s);
        textRepository.updateCurTextNotValid();
        textRepository.insertText(text);
    }

}
